﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace Autocentro.Entities
{
    public class CLIENTE:BaseEntity
    {
        public CLIENTE()
        {
            this.VEHICULOs = new List<VEHICULO>();
            this.Venta = new List<VENTA>();
        }

        public Int32 Id { get; set; }

        [Display(Name = "Ruc_DNI")]
        //[MaxLength(11, ErrorMessage = "El RUC - DNI necesita 8 u 11 dígitos")]
        //[MinLength(8, ErrorMessage = "El RUC - DNI necesita 8 u 11 dígitos")]
        [Required(ErrorMessage = "El RUC o DNI son requeridos")]
        public string Ruc_DNI { get; set; }
        
        [Display(Name = "RazonSocial_Nombre")]
        [Required(ErrorMessage = "La Razón Social es requerida")]
        public string RazonSocial_Nombre { get; set; }
        
        public string Telefono { get; set; }
        public string Direccion { get; set; }


        [Display(Name = "TipoCliente")]
        [Required(ErrorMessage = "El tipo de cliente es requerido")]
        public string TipoCliente { get; set; }


        public List<VENTA> Venta { get; set; }
        public virtual ICollection<VEHICULO> VEHICULOs { get; set; }

        public override string ToString()
        {
            return RazonSocial_Nombre;
        }
    }
}
